package com.realestate.delegate;

import com.realestate.common.RealEstateContants;
import com.realestate.common.ServiceObject;
import com.realestate.dao.LoginDao;
import com.realestate.model.LoginModel;

/**
 * @author sri
 * 
 */
public class LoginDelegate implements IBusinessDelegate {

	private LoginDao dao;

	@Override
	public void performTask(ServiceObject srvObj) {

		if (RealEstateContants.LOGIN.equals(srvObj.getActionMode())) {
			LoginModel loginModel = (LoginModel) srvObj.getDataObject();
			srvObj.setDataObject(dao.validateLogin(loginModel));
		}

	}

	/**
	 * @return the dao
	 */
	public LoginDao getDao() {
		return dao;
	}

	/**
	 * @param dao
	 *            the dao to set
	 */
	public void setDao(LoginDao dao) {
		this.dao = dao;
	}

}
